home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / net / AMarquee1_43.lha / AMarquee / Install_AMarquee < prev    next >
Text File  |  1997-04-28  |  13KB  |  347 lines

  1. ; Installation script for AMarquee
  2. ; by Jeremy Friesner.  Miami support by Fredrik Rambris.
  3.  
  4. (transcript "On installing AMarquee...")
  5.  
  6. (set InstallOpts
  7.     (askoptions
  8.         (
  9.             (prompt "Please indicate which parts of the AMarquee system you wish to install.")
  10.             (help "Which parts of the AMarquee system you should install depend on what you want to do with AMarquee on your system.  Only install the AMarquee server if you wish to use your computer as a host for other Amigas to connect to with their AMarquee programs.  Only install the AMarquee C include files if you wish to write your own AMarquee programs.")
  11.             (choices
  12.                 "amarquee.library"
  13.                 "AMarqueed server"
  14.                 "AMarquee.library C include files"
  15.                 "AMarquee Documentation"
  16.                 "AMarquee Example Programs"
  17.             )
  18.         )
  19.     )
  20. )
  21.  
  22. (if (BITAND InstallOpts 1)
  23.     (
  24.         ; install amarquee.library
  25.         (copylib
  26.             (source "amarquee.library")
  27.             (dest "LIBS:")
  28.         )
  29.     )
  30. )
  31.  
  32. (if (BITAND InstallOpts 2)
  33.     (
  34.         ; install AMarqueed server
  35.  
  36.         (set tcpsys
  37.             (askchoice
  38.                 (prompt "Which TCP software do you wish to run AMarqueed with?")
  39.                 (help @askdir-help)
  40.                 (choices
  41.                     "AmiTCP"
  42.                     "Miami"
  43.                     "Other"
  44.                 )
  45.             )
  46.         )
  47.  
  48.         (if (= tcpsys 2)
  49.           (message "\nThis Installer script only knows how to install AMarqueed for AmiTCP or Miami.  To install AMarqueed for another system, you will need to do it yourself.  See the AMarquee installation documentation for what needs to be done for Miami or AmiTCP; your TCP stack will likely have similar requirements.  This script can still install the other components of the AMarquee package, though.")
  50.           (
  51.             (if (= tcpsys 0)
  52.               (set servdir "AmiTCP:Serv")
  53.               (set servdir
  54.                 (askdir
  55.                     (prompt "Where do you want to put the AMarquee server executable, AMarqueed?")
  56.                     (help @askdir-help)
  57.                     (default "Work:")
  58.                 )
  59.               )  
  60.             )
  61.  
  62.             (copyfiles
  63.               (source "AMarqueed")
  64.               (dest servdir)
  65.             )
  66.  
  67.             (set makeResident
  68.               (askbool
  69.                 (
  70.                     (prompt "\n\nDo you wish to make AMarqueed resident in memory?  This will save memory when multiple connections are active simultaneously.")
  71.                     (help "Making a program resident causes AmigaDOS to keep its executable in memory permanently.  When the program is run, instead of loading a new copy of the code into memory, the resident code is shared by the new process.")
  72.                     (default 1)
  73.                 )
  74.               ) 
  75.             )
  76.  
  77.             (if (= makeResident 1)
  78.               (
  79.                 (set InetDPath "AMarqueed")
  80.                 (startup "AMarqueed" 
  81.                  (prompt ("\n\nOkay to put the line\n\nresident >NIL: %s pure\n\ninto your s:user-startup?" (tackon servdir "AMarqueed")))
  82.                   (help "This line in your user-startup will load AMarqueed into memory so that it can be found when needed by inetd.  If you choose not to add this line here, you will need to execute it somewhere else, or inetd will not be able to find AMarqueed and will refuse AMarqueed connections.")
  83.                     (command ("resident >NIL: %s pure" (tackon servdir "AMarqueed") ) )
  84.                 )
  85.               )
  86.               ; ELSE
  87.                 (
  88.                 (set InetDPath (tackon servdir "AMarqueed") )
  89.               )
  90.             )
  91.             
  92.             ; modify config files!
  93.             (if (= tcpsys 0)
  94.               (
  95.                 ; modify AmiTCP config files
  96.                 (delete "t:edit_text_succeeded")
  97.                 (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/services AMarquee AMarquee^^^^^^^^2957/tcp"))
  98.                 (run
  99.                     (ARexxRunString)
  100.                     (prompt "\n\nTo use AMarqueed with AmiTCP, the line:\n\nAMarquee 2957/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to update the file?  (Note:  AMarquee will not receive connections if this line is not precisely as shown above!)")
  101.                     (help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/services.bak) before writing.")
  102.                     (confirm)
  103.                 )
  104.                 (if (not (exists "t:edit_text_succeeded") )
  105.                     (message "The config file editing script (EditTextFile.rexx) did not complete successfully.  You may need to edit your amitcp:db/services file yourself.  Look in the 'Installation' section of the AMarquee docs for instructions.")
  106.                 )
  107.                 (delete "t:edit_text_succeeded")
  108.                 (set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/inetd.conf AMarquee AMarquee^^^^stream^^^^^^tcp^nowait^root^^^^" InetDPath))
  109.  
  110.                 (run
  111.                     (ARexxRunString)
  112.                     (prompt (cat "\nAlso, the line:\n\nAMarquee stream tcp nowait root " InetDPath "\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to update that file?\n(Note:  AMarquee will not receive connections if this line is not precisely as shown above!)"))
  113.                     (help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
  114.                     (confirm)
  115.                 )
  116.  
  117.                 (if (not (exists "t:edit_text_succeeded") )
  118.                     (message "The config file editing script (EditTextFile.rexx) did not complete successfully.  You may need to edit your amitcp:db/inetd.conf file yourself.  Look in the 'Installation' section of the AMarquee docs for instructions.")
  119.                 )
  120.               )
  121.               (
  122.                 ; Do config files for Miami: Create the textfile with a pointer to AMarqueed
  123.                 (textfile
  124.                    (dest "t:dbtemp")
  125.                    (append
  126.                       "ADD services AMarquee 2957/tcp\n"
  127.                       ("ADD inetd AMarquee stream tcp nowait root %s\n" InetDPath)
  128.                    )
  129.                 )
  130.  
  131.                 ; Add the lines to envarc:MiamiChangeDB (i.e. don't overwrite! Other programs
  132.                 ; may have their lines there too)
  133.                 (run "type t:dbtemp >>envarc:MiamiChangeDB")
  134.  
  135.                 ; If Miami shoule be running... why not make it read the new settings?
  136.                 (run "SYS:Rexxc/RX \"ADDRESS MIAMI.1;changedb\"")
  137.  
  138.                 ; Clean up
  139.                 (delete "t:dbtemp")
  140.               )
  141.             )
  142.  
  143.             ; set ENV vars if desired
  144.             (set ServerOpts
  145.               (askoptions
  146.                 (prompt "There are several ENV variables AMarqueed looks at to determine limits on usage of your system.  Please check the usage limitations you wish to enforce.")
  147.                 (help "Each of these options will set for you an ENV variable.  This variable will be copied into ENVARC: so that it will be retained after rebooting.  To change the setting later, simply edit the file in ENVARC:, or use setenv and then copy the file from env: to envarc: when you are happy with it.")
  148.                 (choices "Limit memory used per session" "Specify minimum amount of memory to keep free" "Limit number of connections per host" "Limit total number of connections" "Ban certain hosts or programs" "Set AMarqueed's execution priority" "Adjust idle-ping rate")
  149.                 (default 0)
  150.               )
  151.             )
  152.  
  153.             (if (BITAND ServerOpts 1)
  154.               (
  155.                 ; AMARQUEED_MAXMEM
  156.                 (set AMarqueed_MaxMem
  157.                     (asknumber
  158.                         (prompt "\n\nSpecify the maximum amount (in kilobytes) of memory that each AMarquee connection may allocate.  (Enter -1 to impose no individual allocation limit)")
  159.                         (help "By setting this value, you can guarantee that no one AMarqueed process will dynamically allocate more than a certain amount of your RAM.")
  160.                         (range -1 99999999999)
  161.                         (default -1)
  162.                     )
  163.                 )
  164.                 ;Else
  165.                 (textfile
  166.                     (dest "ENVARC:AMARQUEED_MAXMEM")
  167.                     (append AMarqueed_MaxMem)
  168.                 )
  169.               )
  170.             )
  171.  
  172.             (if (BITAND ServerOpts 2)
  173.               (
  174.                 ; AMARQUEED_MINFREE
  175.                 (set AMarqueed_MinFree
  176.                     (asknumber
  177.                         (prompt "\n\nSpecify (in kilobytes) the minimum amount of memory that should be left free on your system at all times.  (Enter -1 to impose no minimum free store restriction)")
  178.                         (help "By setting this value, you can guarantee that no AMarqueed process will grab the last kilobytes of memory left in your system.  Of course, this ENV variable cannot affect what other programs do...")
  179.                         (range -1 99999999999)
  180.                         (default -1)
  181.                     )
  182.                 )
  183.                 ;Else
  184.                 (textfile
  185.                     (dest "ENVARC:AMARQUEED_MINFREE")
  186.                     (append AMarqueed_MinFree)
  187.                 )
  188.               )
  189.             )
  190.  
  191.             (if (BITAND ServerOpts 4)
  192.               (
  193.                 ; AMARQUEED_MAXCONN
  194.                 (set AMarqueed_MaxConn
  195.                     (asknumber
  196.                         (prompt "\n\nSpecify the maximum number of simultaneous connections that any one Amiga may have to your AMarquee server. (Enter -1 to impose no maximum number of connections)")
  197.                         (help "This setting will prevent any one client machine from hogging your system by opening too many connections.")
  198.                         (range -1 99999999999)
  199.                         (default -1)
  200.                     )
  201.                 )
  202.  
  203.                 (textfile
  204.                     (dest "ENVARC:AMARQUEED_MAXCONN")
  205.                     (append AMarqueed_MaxConn)
  206.                 )
  207.               )
  208.             )
  209.  
  210.             (if (BITAND ServerOpts 8)
  211.               (
  212.                 ; AMARQUEED_TOTALMAXCONN
  213.                 (set AMarqueed_TotalMaxConn
  214.                     (asknumber
  215.                         (prompt "\n\nSpecify the total maximum number of simultaneous AMarquee connections that can exist on your system at once. (Enter -1 to impose no maximum number of connections)")
  216.                         (help "By setting this value, you can guarantee that no more than (n) Amarquee connections will ever be active at once.  Using this in combination with the AMARQUEED_MAXMEM ENV variable puts a finite limit on the total amount of your RAM that could be in use by Amarqueed at any one time.")
  217.                         (range -1 99999999999)
  218.                         (default -1)
  219.                     )
  220.                 )
  221.                 (textfile
  222.                     (dest "ENVARC:AMARQUEED_TOTALMAXCONN")
  223.                     (append AMarqueed_TotalMaxConn)
  224.                 )
  225.               )
  226.             )
  227.  
  228.             (if (BITAND ServerOpts 16)
  229.               (
  230.                 ; AMARQUEED_BANNED
  231.                 (set AMarqueed_banned
  232.                     (askstring
  233.                         (prompt "\n\nSpecify a regular expression to determine which hosts and/or programs should be banned from your computer. (Enter "" to impose no restrictions)  The regular expression should be in the form /HostExp/ProgExp.  See the Help for examples.")
  234.                         (help "Examples:  To ban all hosts from Australia, use /#?.au/#?.  Or to ban all amarquee clients named Bob, use /#?/Bob.  Or perhaps you have a list of things to ban:  /(evil.hackers.com|sdcc8.ucsd.edu|fred.nerd.org)/#?")
  235.                         (default "")
  236.                     )
  237.                 )
  238.                 (textfile 
  239.                     (dest "ENVARC:AMARQUEED_BANNED")
  240.                     (append AMarqueed_BANNED)
  241.                 )
  242.               )
  243.             )
  244.  
  245.             (if (BITAND ServerOpts 32)
  246.               (
  247.                 ; AMARQUEED_PRIORITY
  248.                 (set AMarqueed_Priority
  249.                     (asknumber
  250.                         (prompt "\n\nSpecify the priority that AMarqueed daemons should execute at.")
  251.                         (help "This is the standard Amiga priority system--lower priority programs get less CPU time when the system is busy, higher priority programs get more.")
  252.                         (range -128 127)
  253.                         (default -10)
  254.                     )
  255.                 )
  256.                 (textfile
  257.                     (dest "ENVARC:AMARQUEED_PRIORITY")
  258.                     (append AMarqueed_Priority)
  259.                 )
  260.               )
  261.             )
  262.  
  263.             (if (BITAND ServerOpts 64)
  264.               (
  265.                 ; AMARQUEED_PINGRATE
  266.                 (set AMarqueed_PingRate
  267.                     (asknumber
  268.                         (prompt "\n\nSpecify the number of minutes of idle time that should elapse before an idle-ping query is issued.")
  269.                         (help "In order to ensure that all connections are still 'live', AMarqueed occasionally sends out an 'are you still there?' request to any client that hasn't been heard from for a while.  Shorter ping rates cause a (very) slight extra demand on network and CPU usage, but cut down on the likelihood of 'dead' connections taking up memory.")
  270.                         (range 1 99999999999)
  271.                         (default 3)
  272.                     )
  273.                 )
  274.                 (textfile 
  275.                     (dest "ENVARC:AMARQUEED_MAXMEM")
  276.                     (append AMarqueed_MaxMem)
  277.                 )
  278.               )
  279.             )
  280.  
  281.             (if (> ServerOpts 0) 
  282.               (run "copy ENVARC:AMARQUEED_#? env:")
  283.             )
  284.           )
  285.         )
  286.     )
  287. )
  288.  
  289.  
  290. (if (BITAND InstallOpts 4) 
  291.     (
  292.         ; install AMarquee SDK
  293.         (set IncludeDir
  294.             (askdir
  295.                 (prompt "Please indicate your Amiga include directory.  This is the directory that contains the clib, libraries, fd, and pragmas subdirectories.")
  296.                 (help "The Installer script is now going to install header files into your Amiga include directory.  The files to be installed include clib/amarquee_protos.h, libraries/amarquee.h, pragmas/amarquee_pragmas.h, and fd/amarquee.fd")
  297.                 (default "include:amiga")
  298.             )
  299.         )
  300.         (copyfiles
  301.             (source "include/amiga")
  302.             (dest IncludeDir)
  303.             (all)
  304.         )
  305.     )
  306. )
  307.  
  308. (if (BITAND InstallOpts 8)
  309.     (
  310.         ; install AMarquee docs
  311.         (set DocDir
  312.             (askdir
  313.                 (prompt "Please indicate the directory to put the AMarquee.guide into:")
  314.                 (help "No new directory will be created!")
  315.                 (default "ram:")
  316.                 (newpath)
  317.             )
  318.         )
  319.         (copyfiles
  320.             (source "AMarquee.guide")
  321.             (dest DocDir)
  322.             (infos)
  323.         )
  324.     )
  325. )
  326.  
  327. (if (BITAND InstallOpts 16)
  328.     (
  329.         ; install AMarquee example programs
  330.         (set ExampleDir
  331.             (askdir
  332.                 (prompt "Please indicate the directory to create the ExamplePrograms directory in.")                (help "A new directory named AMarqueeExamples will be created in the directory you specify.")
  333.                 (default "ram:")
  334.                 (newpath)
  335.             )
  336.         )
  337.         (set FileDir (tackon ExampleDir "AMarqueeExamples"))
  338.         (makedir FileDir)
  339.         (copyfiles
  340.  
  341.             (source "Examples")
  342.             (dest FileDir)
  343.             (all)
  344.         )
  345.     )
  346. )
  347.